package com.yhx.demo;

import com.alibaba.excel.EasyExcel;

import java.util.ArrayList;

/**
 * 使用EasyExcel实现文件写入excel
 */
public class EasyExcelDemo2 {
    public static void main(String[] args) {
        //准备数据
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student(1,"jack",22));
        list.add(new Student(2,"tomer",33));
        list.add(new Student(3,"xixi",12));
        String path="E:/upload/Excel/studentdata2.xlsx";
        EasyExcel.write(path,Student.class)
                .sheet("学上数据2")
                .doWrite(list);
    }
}
